/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.ifrs.poa.control;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;

/**
 *
 * @author karenborges
 */
public class MenuProcessor extends Processor {

    @Override
    public void execute() throws ServletException, IOException {
        getResponse().setContentType("text/html;charset=UTF-8");
        PrintWriter out = getResponse().getWriter();
        String opcao = getRequest().getParameter("opcao");
        int op = Integer.parseInt(opcao);
        switch (op) {
            case 1:
                getResponse().sendRedirect("cadastroUsuario.jsp");
                break;
            case 2:
                getResponse().sendRedirect("cadastroNoticia.jsp");
                break;
            case 3:
                getResponse().sendRedirect("verNoticias.jsp");
                break;
            case 4:
                out.println("<html> <head> <title> SISTEMA DE CADASTRO DE NOTICIAS </title> </head>");
                out.println("<body>");
                out.println("<h1> Adeus !</h1>");
                out.println("</body>");
                out.println("</html>");
                out.close();
                break;
        }
    }
}
